package com.models;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by TimeLiar on 2015/9/22.
 *
 */
public class Table implements Serializable {
    private String name;
    private ArrayList<Column> columns;

    public Table(){
        columns = new ArrayList<>();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ArrayList<Column> getColumns() {
        return columns;
    }

    public void setColumns(ArrayList<Column> columns) {
        this.columns = columns;
    }

    @Override
    public String toString() {
        return columns.toString();
    }

    @Override
    public boolean equals(Object object){
        return !(object == null || !(object instanceof Table))
                && name != null
                && name.equals(((Table) object).getName());
    }
}
